Repository navigation
Harden Serve identity and Codex worker credentials - #342
Merged
Merged
Conversation
Serve identity (#335): the UI accepts Tailscale-User-Login only when the loopback connection that carries it is owned by root, as tailscaled is, read from the kernel socket table. Other local accounts can no longer present the header. Serve's configuration and the sudoers policy are unchanged, so the update applies through the normal forge update. Codex credentials (#336): every Codex worker now receives the access-only snapshot, renewed by the controller to outlive the job deadline; the refresh token never enters a worker container. The codex_parallel_auth setting is retired (still accepted and ignored in stored settings, launch snapshots and older install intents). scrub() also redacts values labelled as refresh tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GvCDky7pWJx1VVhmNxftM4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #335, closes #336.
Serve identity (#335)
In Tailscale Serve mode the UI previously trusted
Tailscale-User-Loginfrom any loopback peer that used the public host name. It now also requires the connecting loopback socket to be owned by root (uid 0), astailscaledis. The UI reads the owner from the kernel's socket table (/proc/net/tcp, visible to the UI container because it uses host networking). If the owner is unknown or not root, no identity is forwarded and GitHub cookie sign-in applies as before.Why not a unix socket? Serve's backend is set by a root-only command (
sudo tailscale serve … http://127.0.0.1:8787), and the installer's sudoers policy allows only that exact command. Moving to aunix:backend would mean:None of that could happen through
forge update. Serve cannot add a custom secret header either. The peer-owner check keeps Serve, sudoers and units unchanged, so a normalforge updatedeploys it with the rebuilt UI. The check fails closed wherever/procis unavailable.Codex worker credentials (#336)
chatgptAuthTokenssnapshot, single runs included. The refresh token never enters a worker container.codex_parallel_authis retired, since nothing needs the full-file path any more. Stored runtime settings, immutable launch snapshots and older install intents or bindings that still carry it are accepted, and the field is ignored.scrub()now also redacts any value labelled as a refresh token (refresh_token/refreshToken, as JSON, escaped JSON or form fields), as defence in depth next to the existing JWT and known-secret redaction.Tests
scrub()redacts labelled refresh tokens;🤖 Generated with Claude Code
https://claude.ai/code/session_01GvCDky7pWJx1VVhmNxftM4